package cn.wolfcode.consumer.helloconsumer;

import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(
        topic = "01-boot",
        consumerGroup = "wolfcode-consumer"
//        messageModel = MessageModel.BROADCASTING
//        messageModel = MessageModel.CLUSTERING
//        selectorExpression = "tagA"
//        selectorType = SelectorType.SQL92,
//        selectorExpression = "age > 10 and name = 'xx'"
)
public class HelloConsumer implements RocketMQListener<MessageExt> {

    @Override
    public void onMessage(MessageExt messageExt) {
        System.out.println("A消费消息"+messageExt);
    }
}
//public class HelloConsumer implements RocketMQListener<String> {
//
//    @Override
//    public void onMessage(String msg) {
//        System.out.println("A消费消息\n"+msg);
//    }
//}
